# -*- encoding:utf-8 -*-
'''
	user.py
	======================
	@descript: 
	@copyright:chinasoft
	@author:cjgong
	@date: 2021-03-04 10:04
	@version:v1.0
'''
import math


class User:
    def __init__(self,user_id,user_name,user_sex,user_height,tel):
        self.v_user_id=user_id
        self.v_user_name=user_name
        self.v_user_sex=user_sex
        self.v_user_height=user_height
        self.v_tel=tel
        pass
    pass
class UserPage:
    def __init__(self,user_list,pageunit,totalrecord,currentpage):
        self.v_user_list=user_list
        self.v_pageunit=pageunit
        self.v_totalrecord=totalrecord
        self.v_currentpage=currentpage
        pass

    def m_gettotalpagenumber(self):
        v_result = math.ceil(self.v_totalrecord / self.v_pageunit)
        return v_result
    def m_getprepageno(self):
        v_result = self.v_currentpage - 1
        if v_result <= 1:
            v_result = 1
            pass
        return v_result
    def m_getnextpageno(self):
        v_result = self.v_currentpage + 1
        if v_result >= self.m_gettotalpagenumber():
            v_result = self.m_gettotalpagenumber()
            pass
        return v_result
    pass